package mudfox.repository;

import mudfox.entity.GenericEntity;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.jpa.repository.Query;

public interface GenericEntityRepository extends CrudRepository<GenericEntity, Integer> {
    Iterable<GenericEntity> findByTopic(String topic);

    Iterable<GenericEntity> findByLabelContaining(String label);

    @Query(value = "select topic from generic_entity group by topic", nativeQuery = true)
    Iterable<String> getTopics();
}
